// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.ast.expr.SQLIntegerExpr;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLAlterTableDropSubpartition.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../expr/SQLIntegerExpr.h"
#include "../../../utils/listTran.h"

SQLAlterTableDropSubpartition::SQLAlterTableDropSubpartition()
{
  partitionIds = std::make_shared<std::list<SQLIntegerExpr_ptr>>();
  subpartitionIds = std::make_shared<std::list<SQLIntegerExpr_ptr>>();
}

// @Override
void SQLAlterTableDropSubpartition::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterTableDropSubpartition)))
  {
    SQLObject_list_ptr tmp1 = ListTran::tran_class<SQLIntegerExpr, SQLObject>(partitionIds);
    acceptChild(visitor, tmp1);
    SQLObject_list_ptr tmp2 = ListTran::tran_class<SQLIntegerExpr, SQLObject>(subpartitionIds);
    acceptChild(visitor, tmp2);
  }
  visitor->endVisit(SharedObject(SQLAlterTableDropSubpartition));
}

SQLIntegerExpr_list_ptr SQLAlterTableDropSubpartition::getPartitionIds()
{
  return partitionIds;
}

void SQLAlterTableDropSubpartition::setPartitionIds(SQLIntegerExpr_list_ptr partitionIds)
{
  this->partitionIds = partitionIds;
}

SQLIntegerExpr_list_ptr SQLAlterTableDropSubpartition::getSubpartitionIds()
{
  return subpartitionIds;
}

void SQLAlterTableDropSubpartition::setSubpartitionIds(SQLIntegerExpr_list_ptr subpartitionIds)
{
  this->subpartitionIds = subpartitionIds;
}
